package cn.janyd.jmall.system.convert;

import cn.janyd.common.core.vo.PageResult;
import cn.janyd.jmall.system.dal.db.dataobject.AdminDO;
import cn.janyd.jmall.system.manager.admin.bo.AdminCreateReqBo;
import cn.janyd.jmall.system.manager.admin.bo.AdminUpdateBO;
import cn.janyd.jmall.system.rpc.admin.dto.AdminCreateReqDTO;
import cn.janyd.jmall.system.rpc.admin.dto.AdminRespDTO;
import cn.janyd.jmall.system.rpc.admin.dto.AdminUpdateReqDTO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * @author Janyd
 * @since 2020-08-15 2:06
 */
@Mapper
public interface AdminConverter {

    AdminConverter INSTANCE = Mappers.getMapper(AdminConverter.class);

    AdminRespDTO convert(AdminDO adminDO);

    PageResult<AdminRespDTO> convert(Page<AdminDO> page);

    AdminDO convert(AdminCreateReqBo adminCreateReq);

    AdminCreateReqBo convert(AdminCreateReqDTO adminCreateReq);

    AdminUpdateBO convert(AdminUpdateReqDTO adminUpdateReq);
}
